
function on_cbzdys_input(el) {
    var ys = new String(el.value);
    if (ys.match(/([^\/]+)[\/／]([^\/]+)/)) {
        document.getElementById("rydjL_CBZD").innerText = "初步诊断:";
    } else {
        document.getElementById("rydjL_CBZD").innerText = "入院诊断:";
    }
}

function on_xzzd_input(el) {
    var zd = new String(el.value);
    var ids = ["rydjL_XZZD", "rydjF_XZZDYS", "rydjL_XZZDRQ", "rydjF_XZZDRQ"];
    if (zd.length == 0) {
        for (var i = 0; i < ids.length; ++i) {
            document.getElementById(ids[i]).style.visibility = "hidden";
        }
        document.getElementById("rydjF_XZZD").style.borderBottomStyle = "none";
    } else {
        for (var i = 0; i < ids.length; ++i) {
            document.getElementById(ids[i]).style.visibility = "visible";
        }
        document.getElementById("rydjF_XZZD").style.borderBottomStyle = "solid";
    }
}

jQuery(document).ready(function (e) {
    on_cbzdys_input(document.getElementById("rydjF_CBZDYS"));
    on_xzzd_input(document.getElementById("rydjF_XZZD"));
    jQuery("textarea.ta_field").bind("input propertychange", function () {
        $jm.textareaAutoHeight(this);
    });
    $("input.ip_jedate").each(function(index, element) {
		if(element.getAttribute("readonly")==null)
		{
			jeDate(element,{
				festival:true,
				//minDate:"1900-01-01",              //最小日期
				//maxDate:"2099-12-31",              //最大日期
				//method:{
				//	choose:function (params) {					
				//	}
				//},
                //isinitVal:true,
				//theme:{ bgcolor:"#00A1CB",color:"#ffffff", pnColor:"#00CCFF"},
				format: this.getAttribute("dateFmt")
			});      
		}
    });
});